package com.lsq.lwf.common.xmlparse;

import java.io.File;
import java.util.Iterator;

import org.apache.commons.lang3.StringUtils;
import org.dom4j.Element;

import com.lsq.lwf.common.xmlparse.base.BaseXml;

public class OrmXmlParse extends BaseXml {
	

	public OrmXmlParse(File file) {
		super(file);
		Element rootElement = doc.getRootElement();

		String namespace = rootElement.attribute("name").getText().trim();
		
		ormNamespaceMap.put(namespace, ormMap);
	}
	
	@SuppressWarnings({ "unchecked", "unused" })
	private void ormParse(Element rootElement){
		
		Element secondRoot= rootElement.element("class-maps");
		Iterator<Element> eIter=secondRoot.elementIterator();
		while(eIter.hasNext()){
			Element childElement=eIter.next();
			String name=childElement.attribute("name").getText().trim();
			String cla=childElement.attribute("class").getText().trim();
			
			Iterator<Element> childIter=childElement.elementIterator();
			
			while(childIter.hasNext()){
				Element e=childIter.next();
				String pname=e.attribute("name").getText();
				String pcolumn=e.attribute("column").getText();
				if(StringUtils.isBlank(pcolumn)){
					pcolumn=pname;
				}
			}
		}
		
	}

}
